package cinema;

import java.util.Date;

public class Log {
    private final Date timestamp;
    private final String operation;
    private final String operator;

    public Log(String operation, String operator) {
        this.timestamp = new Date();
        this.operation = operation;
        this.operator = operator;
    }

    // 记录并输出日志信息
    public void recordLog() {
        System.out.printf("[%s] %s 执行了 %s%n", timestamp, operator, operation);
    }

    // 可选：获取格式化日志信息（不输出）
    public String getLogMessage() {
        return String.format("[%s] %s 执行了 %s", timestamp, operator, operation);
    }
}